package com.dwxt.mall.service;

import com.dwxt.mall.dao.CustomerServiceMapper;
import com.dwxt.mall.entity.CustomerService;
import com.dwxt.mall.entity.CustomerServiceExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CustomerServiceService {
    @Autowired
    private CustomerServiceMapper customerServiceMapper;

    public CustomerService selectPhone() {
        CustomerServiceExample example = new CustomerServiceExample();
        example.createCriteria().andNameEqualTo("客服电话");
        List<CustomerService> customerServices = customerServiceMapper.selectByExample(example);
        return customerServices.size() > 0 ? customerServices.get(0) : null;
    }
}
